﻿using EasyAbp.Abp.Trees;
using Joy.Erp.BasicArchives.Core;
using Joy.Erp.BasicArchives.Core.EntityAttributes;
using System;
using System.Collections.Generic;
using Volo.Abp.MultiTenancy;

namespace Joy.Erp.BasicArchives.Staff
{
    /// <summary>
    /// 部门
    /// </summary>
    public class Department : ArchiveAggregateRoot, IMultiTenant, ITree<Department>
    {
        /// <summary>
        /// 所属租户
        /// </summary>
        public Guid? TenantId { get; set; }

        /// <summary>
        /// 层级
        /// </summary>
        public int Level { get; set; }

        /// <summary>
        /// 父级编号
        /// </summary>
        public Guid? ParentId { get; set; }

        /// <summary>
        /// 父部门
        /// </summary>
        public Department Parent { get; set; }

        /// <summary>
        /// 子部门
        /// </summary>
        public ICollection<Department> Children { get; set; }

        /// <summary>
        /// 部门名称
        /// </summary>
        [Unique]
        public string DisplayName { get; set; }
    }
}
